Component({
    properties: {},
    data: {},
    methods: {
        onReady() {
            const eventChannel = this.getOpenerEventChannel()
            eventChannel.on('getHouseType', (list) => {
                this.setData({
                    list,
                    listKey: Object.keys(list),
                })
            })
        },
        change(e) {
            const id = e.detail.value
            const data = Object.assign(
                this.data.list[id],
                {
                    id: id
                }
            )
            this.setData({
                value: data
            })
        },
        submit() {
            const eventChannel = this.getOpenerEventChannel()
            eventChannel.emit('setHouseType', this.data.value)
            wx.navigateBack()
        }
    }
});
